package com.heima.pojo.dto;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 设备查询请求参数DTO
 */
@Data
@ApiModel(description = "设备查询请求参数")
public class DeviceQueryDTO {

    @ApiModelProperty(value = "页码，默认第一页", example = "1", required = false)
    private Integer pageIndex;

    @ApiModelProperty(value = "页大小，默认10条", example = "10", required = false)
    private Integer pageSize;

    @ApiModelProperty(value = "设备编号", example = "01000001", required = false)
    private String innerCode;

    /**
     * 补充默认值处理（可选）
     * 若前端未传递分页参数，可在这里设置默认值
     */
    public Integer getPageIndex() {
        return pageIndex == null ? 1 : pageIndex;
    }

    public Integer getPageSize() {
        return pageSize == null ? 10 : pageSize;
    }
}
